﻿using Basic.FormRemoteModel;
using Basic.FormRemoteModel.PageCalculate.Model;
using Basic.FormRemoteModel.PageLayout.Chart;
using WeDonekRpc.SqlSugar.VirtualQuery;

namespace Basic.UserFormService.Model
{
    public class ChartBody
    {
        public long Id { get; set; }
        /// <summary>
        /// 页ID
        /// </summary>
        public long PageId { get; set; }

        /// <summary>
        /// 表单ID
        /// </summary>
        public long? FormId { get; set; }

        /// <summary>
        /// 报表类型
        /// </summary>
        public PageChartType ChartType { get; set; }

        /// <summary>
        /// 查询条件
        /// </summary>
        public QueryStruct Query { get; set; }
        /// <summary>
        /// 细分 select列
        /// </summary>
        public Segment[] Segment { get; set; }

        /// <summary>
        /// 列设置
        /// </summary>
        public Dictionary<long, ColTable> Cols { get; set; }
        /// <summary>
        /// 分组
        /// </summary>
        public PageGroupCol[] GroupByCol { get; set; }

        public ChartBody Clone ()
        {
            return new ChartBody
            {
                ChartType = this.ChartType,
                Segment = this.Segment,
                Cols = this.Cols,
                FormId = this.FormId,
                GroupByCol = this.GroupByCol,
                Id = this.Id,
                PageId = this.PageId,
                Query = this.Query.Clone()
            };
        }
    }
    public class MarkLine
    {
        public long ColId { get; set; }

        public string Label { get; set; }
        public string Name { get; set; }

        public ChartMarkLineValType ValType { get; set; }

        public string Color { get; set; }
    }
}
